<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>编辑栏目</title>
	<script type='text/javascript' src='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>
<script src='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/hdjs/hdui/js/hdui.js'></script>
<link href='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/js/hdvalidate.js'></script>
<script src='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/cal/lhgcalendar.min.js'></script>
<script src='http://localhost/Git-SHOP/hdphp/hdphp/Extend/Org/hdjs/hdslide/js/hdslide.js'></script>
<script type='text/javascript'>
HOST = 'http://localhost';
ROOT = 'http://localhost/Git-SHOP';
WEB = 'http://localhost/Git-SHOP/index.php';
URL = 'http://localhost/Git-SHOP/index.php/Admin/Category/edit/cid/7';
APP = 'http://localhost/Git-SHOP/HSHOP';
COMMON = 'http://localhost/Git-SHOP/HSHOP/Common';
HDPHP = 'http://localhost/Git-SHOP/hdphp/hdphp';
HDPHPDATA = 'http://localhost/Git-SHOP/hdphp/hdphp/Data';
HDPHPEXTEND = 'http://localhost/Git-SHOP/hdphp/hdphp/Extend';
MODULE = 'http://localhost/Git-SHOP/index.php/Admin';
CONTROLLER = 'http://localhost/Git-SHOP/index.php/Admin/Category';
ACTION = 'http://localhost/Git-SHOP/index.php/Admin/Category/edit';
STATIC = 'http://localhost/Git-SHOP/Static';
HDPHPTPL = 'http://localhost/Git-SHOP/hdphp/hdphp/Lib/Tpl';
VIEW = 'http://localhost/Git-SHOP/HSHOP/Admin/View';
PUBLIC = 'http://localhost/Git-SHOP/HSHOP/Admin/View/Public';
CONTROLLERVIEW = 'http://localhost/Git-SHOP/HSHOP/Admin/View/Category';
HISTORY = 'http://localhost/Git-SHOP/index.php/Admin/Category/index';
</script>
</head>
<body>
	<div class='wrap'>
		<div class='menu_list'>
			<ul>
				<li><a href="<?php echo U('index');?>">栏目列表</a></li>
				<li><a href="<?php echo U('add');?>">添加栏目</a></li>
		</ul>
		</div>
		<form action="" method='post'>
			<div class='title-header'>编辑栏目</div>
				<!-- 隐藏域传栏目的id -->
			<input type="hidden" name='cid'  value="<?php echo $field['cid'];?>">
			<table class='table1 hd-form'>
				<tr>
					<th>父级</th>
					<td>
						<select name="pid" id="cid">
							<option value="0">顶级</option>
							<?php $hd["list"]["c"]["total"]=0;if(isset($category) && !empty($category)):$_id_c=0;$_index_c=0;$lastc=min(1000,count($category));
$hd["list"]["c"]["first"]=true;
$hd["list"]["c"]["last"]=false;
$_total_c=ceil($lastc/1);$hd["list"]["c"]["total"]=$_total_c;
$_data_c = array_slice($category,0,$lastc);
if(count($_data_c)==0):echo "";
else:
foreach($_data_c as $key=>$c):
if(($_id_c)%1==0):$_id_c++;else:$_id_c++;continue;endif;
$hd["list"]["c"]["index"]=++$_index_c;
if($_index_c>=$_total_c):$hd["list"]["c"]["last"]=true;endif;?>

							<!-- selected,默认选择项,disabled不被选择项 -->
								<option value="<?php echo $c['cid'];?>" <?php echo $c['selected'];?> <?php echo $c['disabled'];?>><?php echo $c['_name'];?></option>
							<?php $hd["list"]["c"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
						</select>
					</td>
				</tr>
				<tr>
					<th>栏目名称</th>
					<td>
						<input type="text" name='cat_name' class='w200' value="<?php echo $field['cat_name'];?>">
					</td>
				</tr>
				<tr>
					<th>商品类型</th>
					<td>
						<select name="cat_id" id="">
					<!-- 		<option value="0">==商品类型==</option> -->
							<?php $hd["list"]["g"]["total"]=0;if(isset($goodsType) && !empty($goodsType)):$_id_g=0;$_index_g=0;$lastg=min(1000,count($goodsType));
$hd["list"]["g"]["first"]=true;
$hd["list"]["g"]["last"]=false;
$_total_g=ceil($lastg/1);$hd["list"]["g"]["total"]=$_total_g;
$_data_g = array_slice($goodsType,0,$lastg);
if(count($_data_g)==0):echo "";
else:
foreach($_data_g as $key=>$g):
if(($_id_g)%1==0):$_id_g++;else:$_id_g++;continue;endif;
$hd["list"]["g"]["index"]=++$_index_g;
if($_index_g>=$_total_g):$hd["list"]["g"]["last"]=true;endif;?>

								<option value="<?php echo $g['cat_id'];?>" <?php if($field['cat_id'] == $g['cat_id']){?>selected=""<?php }?>><?php echo $g['cat_name'];?></option>
							<?php $hd["list"]["g"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
						</select>
					</td>
				</tr>
				<tr>
					<th>状态</th>
					<td>
						<label>
							<input type="radio" name='is_show' value="0" <?php if($field['is_show'] ==0){?>checked=""<?php }?>>隐藏
						</label>
						<label>
							<input type="radio" name='is_show' value="1" <?php if($field['is_show'] ==1){?>checked=""<?php }?>>显示
						</label>
					</td>
				</tr>
				<tr>
					<th>单位</th>
					<td>
						<input type="text" value="<?php echo $field['measure_unit'];?>" name='measure_unit' class='w200'> 
					</td>
				</tr>
				<tr>
					<th>价格区间</th>
					<td>
						<input type="text"  name='grade' class='w200' value="<?php echo $field['grade'];?>"> 
					</td>
				</tr>
				<tr>
					<th>关键字</th>
					<td>
						<input type="text" name='cat_key' class='w200' value="<?php echo $field['cat_key'];?>"> 
					</td>
				</tr>
				<tr>
					<th>描述</th>
					<td>
						<textarea name="cat_desc" class='w300 h100'><?php echo $field['cat_desc'];?></textarea>
					</td>
				</tr>
			</table>
			<input type="submit" class='hd-success' value='编辑'/>
		</form>
	</div>
</body>
</html>